import request from '@/utils/request'

let baseUrl = "/base/admin/announcement"

export function list(query) {
  return request({
    url: `${baseUrl}/list`,
    method: 'get',
    params: query
  })
}

export function query(id) {
  return request({
    url: `${baseUrl}/query/${id}`,
    method: 'get',
  })
}

export function saveOrUpdate(data) {
  return request({
    url: `${baseUrl}/saveOrUpdate`,
    method: 'post',
    data: data
  })
}

export function del(typeIds) {
  return request({
    url: `${baseUrl}/delete`,
    method: 'delete',
    data:typeIds
  })
}

export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: `${baseUrl}/disabled`,
    method: 'put',
    data: data
  })
}

